home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / if_end.arc / IF-END.DOC next >
Text File  |  1987-10-06  |  3KB  |  76 lines

  1.                                     IF-END
  2.  
  3.                 COPYRIGHT 1987 NELSON FORD ALL RIGHTS RESERVED
  4.  
  5.  
  6.          Individual users are hereby granted a limited license to use
  7.          and copy this program so long as such copying is not done as
  8.          part of any commerical enterprise.  Any commercial use or
  9.          distribution of this code without the written permission of
  10.          the author is a violation of Federal copyright law.  This
  11.          copy has been put on CompuServe by the author for distribu-
  12.          tion there.
  13.  
  14.                                  Nelson Ford
  15.                              4845 Willowbend Blvd
  16.                             Houston, TX 77235-5705
  17.                                  713-721-6104
  18.  
  19.  
  20.          The purpose of this program is to check for IF - END IF
  21.          pairs.  I suppose that with proper programming techinques,
  22.          such as using small, seperately compiled modules, this
  23.          utility is not necessary.  However, if you ever do get the
  24.          dreaded "IF without END IF" error message during a compile,
  25.          you will find that QB is not much help in finding the actual
  26.          error.  That's because figuring out which END-IF's go with
  27.          which IF's requires some assumptions.
  28.  
  29.          The assumption in this program is that code is properly
  30.          indented.  For an example of "proper" indentation, see the
  31.          code in this program.  To sum it up, for a block-IF segment,
  32.          the IF and END IF must be indented by the same amount and the
  33.          code inbetween must be further indented, with the exception
  34.          that the IF statement can be split into several lines, each
  35.          with the same indentation.  For example
  36.  
  37.                             IF  A=B_
  38.                             AND C=D_
  39.                             OR  E=F THEN
  40.                               GOSUB Do.something
  41.                             END IF
  42.  
  43.          The above code is "properly" indented.  Also, remember that
  44.  
  45.                             IF  A=B_
  46.                             AND C=D_
  47.                             OR  E=F THEN_
  48.                               GOSUB Do.something
  49.  
  50.          is NOT a block IF because of the line continuation character
  51.          ("_") following the THEN.  And of course block-IF's and non
  52.          block-IF's can be combined:
  53.  
  54.                             IF x=y THEN
  55.                               IF l=m THEN a=b
  56.                               IF m=n THEN
  57.                                 c=d
  58.                               END IF
  59.                             END IF
  60.  
  61.          To use this utility, keep it in your QB subdirectory.  If you
  62.          get an IF without END IF error message, save the file you are
  63.          working on, shell to DOS and run IF-END on your saved code.
  64.          Then exit back to QB and fix the errors.
  65.  
  66.  
  67.          ------------------------------------------------------------
  68.  
  69.          For a list of other QB programming tools, subroutines and
  70.          tips, write or call for a newsletter/catalog from the
  71.  
  72.                           Public (Software) Library
  73.                                 P.O.Box 35705
  74.                             Houston, TX 77235-5705
  75.                                  713-721-5205
  76.